package com.example.keli.ui.my.love;

import android.support.v4.view.ViewPager;
import android.view.View;

import com.example.keli.R;
import com.example.keli.base.BaseActivity;
import com.example.keli.ui.home.adapter.FragmentAdapter;
import com.flyco.tablayout.SlidingTabLayout;

import java.util.Arrays;
import java.util.List;

import butterknife.BindView;

public class LoveActivity extends BaseActivity {


    @BindView(R.id.tabLayout)
    SlidingTabLayout slidingTabLayout;
    @BindView(R.id.viewPager)
    ViewPager viewPager;
    private FragmentAdapter mFragmentAdapter;

    protected final List<String> sTitle = Arrays.asList("我喜欢的", "喜欢我的");

    @Override
    protected int layoutId() {
        return R.layout.activity_star;
    }

    @Override
    protected void bindData() {
        abTitle.setText("心动");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mFragmentAdapter = new FragmentAdapter(getSupportFragmentManager());
        mFragmentAdapter.addFragment(LoveSendFragment.newInstance(), sTitle.get(0));
        mFragmentAdapter.addFragment(LoveReceiveFragment.newInstance(), sTitle.get(1));
        viewPager.setAdapter(mFragmentAdapter);
        slidingTabLayout.setViewPager(viewPager);
//        slidingTabLayout.setOnTabSelectListener(this);
        viewPager.setCurrentItem(0);
    }

}
